package com.bw.wxy.mvp.model;

import com.bw.wxy.common.Api;
import com.bw.wxy.mvp.model.entity.BaseEntity;
import com.bw.wxy.mvp.model.entity.TokenEntity;
import com.bw.wxy.factroy.ChangFunction;
import com.bw.wxy.factroy.HttpFactory;
import com.bw.wxy.factroy.HttpType;
import com.bw.wxy.mvp.base.model.BaseModel;
import com.bw.wxy.mvp.contract.SplashContract;

import java.util.Map;

import javax.inject.Inject;

import io.reactivex.Observable;

public class SplashModel extends BaseModel implements SplashContract.ISplashModel {
    @Inject
    public SplashModel(){
    }


    @Override
    public Observable<BaseEntity> requestToken(Map<String, Object> map) {
        Observable<TokenEntity>ob= HttpFactory.getInstance()
                .factory(HttpType.SINGTYPE).getRetrofit()
                .create(Api.class).requestToken(createBody(map));
        return ob.map(new ChangFunction<TokenEntity>());
    }

}

